import { ref } from 'vue'

export default {
    install: (app, options) => {
        const language = ref('cn')
        app.config.globalProperties.$t = (key) => {
            return key.split('.').reduce((o, p) => {
                if(o) return o[p];
            }, options[language.value])
        }
        app.provide('i18n', {
            language,
        })
        
        
    }
    
}